Self Keyword

Self is a reference to an object's parent object.


Notes

When called within the method of an object on a form, Self will always be a reference to the object's parent window. This means that in a PushButton control's Action event handler:

Left=100 and Self.Left=100

mean the same thing because, in the absence of an object identifier, the parent object (in this case, the window the PushButton in a part of) is assumed.

For code for a control in a window, "Self" refers to the window, and Me refers to the control.

When Self is called within the method of a class, Self will be a reference to the instance of the class in use. This is usually not necessary since, as stated, in the absence of an object identifier, the parent or super object is assumed.


See Also

Me keyword.